


//
//  ResidenceTableview.m
//  tableview多按钮选择
//
//  Created by MB__Lee on 2018/5/17.
//  Copyright © 2018年 MB__Lee. All rights reserved.
//

#import "ResidenceTableview.h"

@implementation ResidenceTableview

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style{
    if (self = [super initWithFrame:frame style:style]) {
        self.mut = @[@[@"拎包入住",@"首次出租",@"采光好",@"停车位多",@"近地铁",@"近商业街",@"有电梯",@"有阳台",@"有花园",@"有楼阁",@"有地下室"],
                     @[@"豪华装修",@"中等装修",@"普通装修",@"无装修"],
                     @[@"朝东",@"朝西",@"朝南",@"朝北",@"东南",@"东北",@"西南",@"西北",@"南北",@"东西"],
                    ];
        self.topLabelMut = @[@"特色",@"装修",@"朝向",@"楼层"];
        
        
        
        //计算高度
        NSUInteger num = 0;
        for (NSArray *arr in self.mut) {
            num += arr.count;
        }
        num += self.mut.count * 3;
        
        
        //collectioncell 的高度 + cellTopLabel + 底部footer 高度
        CGFloat height = num / 4 * (Margin + itemHeight) +  3 *44 + MBScale(60);
        
        CGRect frame = self.frame;
        frame.size.height = height;
        self.frame = frame;
        
        
    }
    return  self;
}
@end
